import logging
import os

file_path = os.path.join(os.path.dirname(__file__), "logs")
if not os.path.exists(file_path):
    os.mkdir(file_path)

logger = logging.getLogger("happy server")
logger.setLevel(logging.DEBUG)
logger_formatter = logging.Formatter(
    "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
# logger_file_handler = logging.FileHandler(file_path)
# logger_file_handler.setLevel(logging.WARNING)
# logger_file_handler.setFormatter(logger_formatter)

logger_stream_handler = logging.StreamHandler()
logger_stream_handler.setLevel(logging.DEBUG)
logger_stream_handler.setFormatter(logger_formatter)

# logger.addHandler(logger_file_handler)
logger.addHandler(logger_stream_handler)
if __name__ == "__main__":
    print("file_path", file_path)
